/*
 * https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=13880253762
 */

Page({

    data: {
        inputValue: '',
        loading: false,
        photoData: '',
    },

    search: function() {
        let tthis = this;
        if (tthis.data.inputValue) {
            wx.request({
                url: 'https://tcc.taobao.com/cc/json/mobile_tel_segment.htm',
                data: { 'tel': tthis.data.inputValue },
                method: 'GET',
                dataType: 'json',
                success: function(res) {
                    tthis.showToView(res.data);
                    //console.log(12, res.data)
                }
            })
        }
    },

    bindKeyInput: function(e) {
        console.log(e.detail.value);
        this.setData({
            inputValue: e.detail.value
        })
    },

    searchPhoto: function() {
        this.search();
    },

    showToView: function(data) {
        console.log('输出', data);
        this.setData({
            photoData: data
        })
    }
})